<template>
  <view class="content1">
    <view class="item">
      <view class="title">{{ title }}</view>
      <view
        class="item_view"
        v-for="(item, index) in list"
        :key="index"
        @click="goPage(item)"
      >
        <view class="item_view_img">
          <image :src="item.file_url" mode=""></image>
        </view>
        <view
          class="item_view_right"
          :class="list.length == index + 1 ? 'item_view_right1' : ''"
        >
          <view
            class="item_view_right_text"
            :class="item.aa == '已结束' ? 'item_view_right_text1' : ''"
            >{{ item.name }}</view
          >
          <view
            class="item_view_right_schedule"
            :class="
              item.msg_status == '已结束' ? 'item_view_right_schedule_end' : ''
            "
          >
            <view class="b_view" v-if="showCount">
              <image
                src="@/static/images/slices/icon_sy_liulanlaing.png"
                mode=""
              ></image>
              {{ item.history_count }}
            </view>
            <view>{{ item.msg_status }}</view>
          </view>
        </view>
      </view>
    </view>
  </view>
</template>
<script>
export default {
  props: {
    list: {
      type: Array,
      default: function () {
        return [];
      },
    },
    title: {
      type: String,
      default: "",
    },
    isIndex: {
      type: Boolean,
      default: false,
    },
    showCount:{
      type: Boolean,
      default: false,
    }
  },
  data() {
    return {
      // list: [
      //   {
      //     img: "https://cdn.uviewui.com/uview/album/1.jpg",
      //     text: "一田研学火热开启中，有兴趣的可以前来咨询相关政策和内容",
      //     schedule: "进行中",
      //   },
      //   {
      //     img: "https://cdn.uviewui.com/uview/album/1.jpg",
      //     text: "一田研学火热开启中，有兴趣的可以前来咨询相关政策和内容",
      //     schedule: "进行中",
      //   },
      //   {
      //     img: "https://cdn.uviewui.com/uview/album/1.jpg",
      //     text: "一田研学火热开启中，有兴趣的可以前来咨询相关政策和内容",
      //     schedule: "已结束",
      //   },
      // ],
    };
  },
  methods: {
    goPage(item) {
      if (this.isIndex) {
        uni.navigateTo({
          url: `/pages/detail/wenDetail?id=${item.id}`,
        });
        return;
      }
    },
  },
};
</script>
<style scoped lang="scss">
.content1 {
  padding: 30rpx 30rpx 0 30rpx;
  box-sizing: border-box;
  .item {
    background: rgba(39, 39, 39, 0.5);
    border-radius: 16rpx;
    // margin-bottom: 24rpx;
    // padding: 32rpx;
    .title {
      font-size: 32rpx;
      color: #eeeeee;
      padding: 32rpx 32rpx 0 32rpx;
    }
  }
  .item_view {
    display: flex;
    padding-left: 32rpx;
    margin-top: 35rpx;
    .item_view_img {
      width: 160rpx;
      height: 160rpx;
      border-radius: 16rpx;
      //   padding: 23rpx 0;
      image {
        width: 160rpx;
        height: 160rpx;
        border-radius: 16rpx;
      }
    }
    .item_view_right {
      height: 160rpx;
      width: 100%;
      margin-left: 24rpx;
      border-bottom: 1rpx solid #ffffff;
      padding-right: 32rpx;
      padding-bottom: 32rpx;
      display: flex;
      flex-direction: column;
      justify-content: space-between;
      .item_view_right_text {
        font-size: 28rpx;
        color: #eeeeee;
        display: -webkit-box;
        -webkit-box-orient: vertical;
        overflow: hidden;
        -webkit-line-clamp: 2;
        text-overflow: ellipsis;
      }
      .item_view_right_text1 {
        color: #adadad;
      }
      .item_view_right_schedule {
        font-size: 26rpx;
        color: #55b877;
        display: flex;
        justify-content: space-between;
        align-items: center;
        .b_view {
          font-size: 24rpx;
          font-family: PingFang SC, PingFang SC;
          font-weight: 400;
          color: #adadad;
          display: flex;
          align-items: center;
          image {
            width: 28rpx;
            height: 20rpx;
            margin-right: 8rpx;
          }
        }
        // margin-top: 50rpx;
      }
      .item_view_right_schedule_end {
        color: #adadad;
      }
    }
    .item_view_right1 {
      border: none;
    }
  }
}
</style>